<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
<head>
    <meta charset="utf-8">
    <title th:text="${title}"></title>

    <link rel="stylesheet" href="css/login-style.css" type="text/css">
    <!-- Bootstrap -->
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="css/fontawesome-all.min.css">

    <script src="js/bootstrap.min.js"></script>

</head>
<body class="template-bg-image">

<div class="container">
    <div class="col-md-12">
        <form class="form-horizontal template-login-form" role="form" th:action="@{/login}" method="post">
            <div class="row">
                <div class="col-md-12">
                    <h1>快捷文档共享</h1>
                </div>
            </div>
            <div>
                <div>
                    <div class="form-group">
                        <div class="col-md-12">
                            <label for="username" class="control-label">登录账号</label>
                            <div class="template-input-icon-container">
                                <i class="fa fa-user"></i>
                                <input type="text" class="form-control" placeholder="用户名" required="required"
                                       id="username" name="username"/>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-md-12">
                            <label for="password" class="control-label">登录密码</label>
                            <div class="template-input-icon-container">
                                <i class="fa fa-lock"></i>
                                <input type="password" class="form-control" placeholder="密码" required="required"
                                       id="password" name="password"/>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-md-12">
                            <div class="alert alert-warning" th:if="${param.error}"
                                 th:with="errorMsg=${session['SPRING_SECURITY_LAST_EXCEPTION'].message}">
                                登录异常：<span th:text="${errorMsg}">输入信息有误！</span>
                            </div>
                            <div class="alert alert-success" th:if="${param.logout}">
                                成功退出！
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-md-12">
                            <input type="submit" value="登录" class="btn btn-warning">
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>
</body>
</html>